﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class salary_standardToController : Controller
    {
        private readonly Isalary_standard he;

        public salary_standardToController(Isalary_standard he)
        {
            this.he = he;
        }

        public IActionResult salary_standardTo()
        {
            return View();
        }
        public IActionResult salary_standardToUpdate(int? id)
        {
            ViewBag.ssd_id = id;
            return View();
        }
        //薪酬查询
        public async Task<IActionResult> Quer(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Quer(currentPage, pageSize)));
        }
        //薪酬基本查询
        public async Task<IActionResult> Chui(int id)
        {
            return Content(JsonConvert.SerializeObject(await he.Chui(id)));
        }
        //薪酬详细数据表查询
        public async Task<string> ChuiTo(string id)
        {
            return await he.ChuiTo(id);
        }
        //薪酬复核通过修改
        public async Task<int> Updateou(salary_standard standard)
        {
            return await he.Updateou(standard);
        }
    }
}
